package com.my.xl.salary.billdemo.dao;

import com.my.xl.salary.billdemo.mapper.SalaryCodeMapper;
import com.my.xl.salary.billdemo.pojo.SalaryCode;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

@Repository
public class CodeDao {
    @Resource
    private SalaryCodeMapper codeMapper;


    public SalaryCode isCode(String userId) {
        return codeMapper.isExistCode(userId);
    }

    public boolean add(SalaryCode s) {
        int num=codeMapper.insert(s);
        return num>0;
    }

    public boolean update(SalaryCode s) {
        int up=codeMapper.updateCodeByUserId(s);
        return up>0;

    }

    public SalaryCode checkCodeByUserId(String userId) {
        return codeMapper.checkCodeByUserId(userId);
    }



}
